<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>登录</title>
</head>
<body>
<?php
/**
 * Created by PhpStorm.
 * User: iceberg
 * Date: 2018-10-10
 * Time: 10:36
 */
session_start();
if(!isset($_SESSION['is_login']))
{
    //var_dump($_SESSION['name']);die;
    header("location:login.php");
}
if(isset($_POST['submit']))
{
    if(isset($_POST['logout1'])){
        unset($_SESSION['is_login']);
        header("location:login.php");
    }else
    {
        unset($_SESSION['is_login']);
        unset($_SESSION['name']);
        header("location:login.php");
    }
}

?>
<h1>请您注销！</h1>
<form method="post">
    <input type="hidden" name="logout1" value="logout1" />
    <input type="submit" name="submit" value="注销保存用户名" />
</form>
<hr/>
<form method="post">
    <input type="hidden" name="logout2" value="logout2" />
    <input type="submit" name="submit" value="注销不保存用户名" />
</form>
</body>
</html>
